<div class="edit">
    <form id="editForm" method="post">
        <div id="win"></div>
        <table class="infobox" width="100%" border="0" cellspacing="5px"
               cellpadding="1px">
            <tr>
                <td width="23%"><label>名称：</label></td>
                <td width="77%"><input name="name" type="text" style="width:200px;" value="${(hospital.name)!''}"
                                       class="easyui-validatebox" autocomplete="off"/></td>
            </tr>
            <tr>
                <td width="23%"><label>等级：</label></td>
                <td width="77%">
                    <input class="easyui-combobox" name="grade" id="gradeView" style="width:200px"
                           panelHeight="300px" value="${(hospital.grade)!''}"
                           data-options="editable:false">
                    <#--<input name="legalRepresentative" type="text" style="width:200px;" value="${(company.legalRepresentative)!''}"-->
                                       <#--class="easyui-validatebox" autocomplete="off"/>-->
                </td>
            </tr>
            <tr>
                <td width="23%"><label>医院类型：</label></td>
                <td width="77%">
                    <input class="easyui-combobox" name="type" id="typeView" style="width:200px"
                           panelHeight="300px" value="${(hospital.type)!''}"
                           data-options="editable:false">
                    <#--<input name="businessLicense" type="text" style="width:200px;" value="${(company.businessLicense)!''}"-->
                                       <#--class="easyui-validatebox" autocomplete="off"/>-->
                </td>
            </tr>
            <tr>
                <td width="23%"><label>联系人：</label></td>
                <td width="77%"><input name="contactPerson" type="text" style="width:200px;" value="${(hospital.contactPerson)!''}"
                                       class="easyui-validatebox" autocomplete="off"/></td>
            </tr>
            <tr>
                <td width="23%"><label>联系电话：</label></td>
                <td width="77%"><input name="contactPhone" type="text" style="width:200px;" value="${(hospital.contactPhone)!''}"
                                       class="easyui-validatebox" autocomplete="off"/></td>
            </tr>
            <tr>
                <td width="23%"><label>省份：</label></td>
                <td width="77%">
                    <input class="easyui-combobox" name="province" id="province" style="width:200px" required="true"
                           panelHeight="250px" value="${(hospital.province)!''}"
                           data-options="editable:false">
                        <#--<input id="province" name="province" type="text" style="width: 150px"-->
                               <#--value="${(company.province)!''}"-->
                        <#--/>-->
                    <#--<input name="province" type="text" style="width:200px;" value="${(company.province)!''}"-->
                                       <#--class="easyui-validatebox" autocomplete="off"/>-->
                </td>
            </tr>
            <tr>
                <td width="23%"><label>城市：</label></td>
                <td width="77%">
                    <input class="easyui-combobox" name="city" id="city" style="width:200px" required="true"
                           panelHeight="250px" value="${(hospital.city)!''}"
                           data-options="editable:false">
                        <#--<input id="city" name="city" type="text" style="width: 150px"-->
                               <#--value="${(company.city)!''}"-->
                        <#--/>-->
                    <#--<input name="city" type="text" style="width:200px;" value="${(company.city)!''}"-->
                                       <#--class="easyui-validatebox" autocomplete="off"/>-->
                </td>
            </tr>
            <tr>
                <td width="23%"><label>区县：</label></td>
                <td width="77%">
                    <input class="easyui-combobox" name="district" id="district" style="width:200px" required="true"
                           panelHeight="250px" value="${(hospital.district)!''}"
                           data-options="editable:false">
                        <#--<input id="district" name="district" type="text" style="width: 150px"-->
                               <#--value="${(company.district)!''}"-->
                        <#--/>-->
                    <#--<input name="district" type="text" style="width:200px;" value="${(company.district)!''}"-->
                                       <#--class="easyui-validatebox" autocomplete="off"/>-->
                </td>
            </tr>
            <tr>
                <td width="23%"><label>地址：</label></td>
                <td width="77%"><input name="address" type="text" style="width:200px;" value="${(hospital.address)!''}"
                                       class="easyui-validatebox" autocomplete="off"/></td>
            </tr>
            <tr>
                <td width="23%"><label>备注：</label></td>
                <td width="77%"><input name="remark" type="remark" style="width:200px;" value="${(hospital.remark)!''}"
                                       class="easyui-validatebox" autocomplete="off"/></td>
            </tr>
        </table>
        <input hidden type="text" name="id" value="${(hospital.id)!''}">
    </form>
</div>
<script type="text/javascript">
    $('#province').combobox({
        url: '/common/getRegionChildren?pid=1',
        valueField: 'id',
        textField: 'name',
        onChange:function (n,o) {
            $('#city').combobox('clear');
                var url='/common/getRegionChildren?pid='+n;
                $('#city').combobox('reload', url);
        }
    });
    var firstDefaultValue=${(hospital.province)!"-1"}+"";
    if(firstDefaultValue===''||firstDefaultValue===null)
    {
        firstDefaultValue='-1';
    }
    $('#city').combobox({
        url: '/common/getRegionChildren?pid='+firstDefaultValue,
        valueField: 'id',
        textField: 'name',
        onChange:function (n,o) {
            $('#district').combobox('clear');
            var url='/common/getRegionChildren?pid='+n;
            $('#district').combobox('reload', url);

        }
    });

    var secondDefaultValue=${(hospital.city)!"-1"}+"";
    if(secondDefaultValue===""||secondDefaultValue===null)
    {
        secondDefaultValue="-1";
    }
    $('#district').combobox({
        url: '/common/getRegionChildren?pid='+secondDefaultValue,
        valueField: 'id',
        textField: 'name',
    });

    $("#gradeView").combobox({
        url: '/common/getDictionary?code=yydj',
        valueField: 'id',
        textField: 'name'
    });
    $("#typeView").combobox({
        url: '/common/getDictionary?code=yylx',
        valueField: 'id',
        textField: 'name'
    });
</script>